# -*- coding:utf-8 -*-

import redis


class Redis:
    def __init__(self, host='localhost', port=6379, db=0, max_connections=3):
        self.conn_pool = redis.ConnectionPool(
            host=host, port=port, db=db, max_connections=max_connections)

    @property
    def conn(self) -> redis.Redis:
        return redis.Redis(connection_pool=self.conn_pool)


if __name__ == '__main__':
    db = Redis()
    c = db.conn
